package com.smashcrush.server.security;

import java.lang.reflect.Method;

import org.apache.log4j.Logger;
import org.springframework.aop.MethodBeforeAdvice;

public class SecurityAdvice implements MethodBeforeAdvice {

	private final Logger log = Logger.getLogger(SecurityAdvice.class);

	public void before(Method method, Object[] objects, Object o)
			throws Throwable {
		log.debug("Checking Security For Method: " + method.getDeclaringClass()
				+ "." + method.getName());

		boolean isAllowAll = false;

		Authorization auth = method.getAnnotation(Authorization.class);

		if (auth.allowAll()) {
			return;
		}

	}

}